{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Scatter, Bar, Line, Pie, Boxplot, WordCloud\n",
    "from pyecharts import options as opts\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"72394ccc6d55436ea9c664176b07498b\" style=\"width:800px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_72394ccc6d55436ea9c664176b07498b = echarts.init(\n",
       "                    document.getElementById('72394ccc6d55436ea9c664176b07498b'), 'white', {renderer: 'canvas'});\n",
       "                var option_72394ccc6d55436ea9c664176b07498b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 20,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.5837496955902521,\n",
       "                    0.37916254136824745\n",
       "                ],\n",
       "                [\n",
       "                    0.9671448231296265,\n",
       "                    0.9312841106153879\n",
       "                ],\n",
       "                [\n",
       "                    0.6997650173659294,\n",
       "                    0.10533290924320204\n",
       "                ],\n",
       "                [\n",
       "                    0.20146168316884094,\n",
       "                    0.06368174842386465\n",
       "                ],\n",
       "                [\n",
       "                    0.4513730021638629,\n",
       "                    0.8871988317658371\n",
       "                ],\n",
       "                [\n",
       "                    0.8424482051573408,\n",
       "                    0.5105342907621802\n",
       "                ],\n",
       "                [\n",
       "                    0.5902514659489418,\n",
       "                    0.6810353148196329\n",
       "                ],\n",
       "                [\n",
       "                    0.536988871627748,\n",
       "                    0.7985841301129478\n",
       "                ],\n",
       "                [\n",
       "                    0.8488087756984736,\n",
       "                    0.15256470715719528\n",
       "                ],\n",
       "                [\n",
       "                    0.12069800783529394,\n",
       "                    0.9725692292034384\n",
       "                ],\n",
       "                [\n",
       "                    0.92522117332027,\n",
       "                    0.8860420442478726\n",
       "                ],\n",
       "                [\n",
       "                    0.26078975546896344,\n",
       "                    0.5404235456820871\n",
       "                ],\n",
       "                [\n",
       "                    0.020151990007058695,\n",
       "                    0.6697637865436414\n",
       "                ],\n",
       "                [\n",
       "                    0.8228417062479376,\n",
       "                    0.012279495524296524\n",
       "                ],\n",
       "                [\n",
       "                    0.7265434286137165,\n",
       "                    0.6737924808845345\n",
       "                ],\n",
       "                [\n",
       "                    0.4301993598477174,\n",
       "                    0.10517636662337171\n",
       "                ],\n",
       "                [\n",
       "                    0.569448836509882,\n",
       "                    0.6011579304240431\n",
       "                ],\n",
       "                [\n",
       "                    0.7221356461186997,\n",
       "                    0.8059981474847899\n",
       "                ],\n",
       "                [\n",
       "                    0.18007298978867625,\n",
       "                    0.8888334157647095\n",
       "                ],\n",
       "                [\n",
       "                    0.9461478956783592,\n",
       "                    0.6539704249251136\n",
       "                ],\n",
       "                [\n",
       "                    0.9235362788235575,\n",
       "                    0.44589279928951375\n",
       "                ],\n",
       "                [\n",
       "                    0.4714499513988777,\n",
       "                    0.6770114987320364\n",
       "                ],\n",
       "                [\n",
       "                    0.7466286590521666,\n",
       "                    0.6975445441422872\n",
       "                ],\n",
       "                [\n",
       "                    0.9620675161745674,\n",
       "                    0.30529853092765014\n",
       "                ],\n",
       "                [\n",
       "                    0.9582477933889997,\n",
       "                    0.8447999679062888\n",
       "                ],\n",
       "                [\n",
       "                    0.3573194348447061,\n",
       "                    0.04838193097569221\n",
       "                ],\n",
       "                [\n",
       "                    0.027391136789759463,\n",
       "                    0.9608249381283861\n",
       "                ],\n",
       "                [\n",
       "                    0.25744601306952253,\n",
       "                    0.3194808209636275\n",
       "                ],\n",
       "                [\n",
       "                    0.536506118745446,\n",
       "                    0.553010958431572\n",
       "                ],\n",
       "                [\n",
       "                    0.3111057204725436,\n",
       "                    0.4647311533664995\n",
       "                ],\n",
       "                [\n",
       "                    0.7929823585706373,\n",
       "                    0.4930703040904184\n",
       "                ],\n",
       "                [\n",
       "                    0.5809272795950049,\n",
       "                    0.46110525103382294\n",
       "                ],\n",
       "                [\n",
       "                    0.3911015468036271,\n",
       "                    0.13507252007597614\n",
       "                ],\n",
       "                [\n",
       "                    0.7464617069156217,\n",
       "                    0.8143215624576527\n",
       "                ],\n",
       "                [\n",
       "                    0.22641182409089422,\n",
       "                    0.008800809881794991\n",
       "                ],\n",
       "                [\n",
       "                    0.9743908958801684,\n",
       "                    0.5188932468430686\n",
       "                ],\n",
       "                [\n",
       "                    0.0767688559573777,\n",
       "                    0.9947471133875955\n",
       "                ],\n",
       "                [\n",
       "                    0.08737735827543502,\n",
       "                    0.6676018963339541\n",
       "                ],\n",
       "                [\n",
       "                    0.2737693866313221,\n",
       "                    0.5539461440172009\n",
       "                ],\n",
       "                [\n",
       "                    0.17399279912393373,\n",
       "                    0.2863645214064183\n",
       "                ],\n",
       "                [\n",
       "                    0.01731323698477094,\n",
       "                    0.4792048656080503\n",
       "                ],\n",
       "                [\n",
       "                    0.3742066391603923,\n",
       "                    0.01619413058454877\n",
       "                ],\n",
       "                [\n",
       "                    0.6809384581307671,\n",
       "                    0.8081578819669099\n",
       "                ],\n",
       "                [\n",
       "                    0.015935019349134327,\n",
       "                    0.3181862471805077\n",
       "                ],\n",
       "                [\n",
       "                    0.6316913728119795,\n",
       "                    0.520729692150832\n",
       "                ],\n",
       "                [\n",
       "                    0.7117085435846813,\n",
       "                    0.3346454250724292\n",
       "                ],\n",
       "                [\n",
       "                    0.9146248874874027,\n",
       "                    0.2948009952463456\n",
       "                ],\n",
       "                [\n",
       "                    0.8520439213593987,\n",
       "                    0.33245428161551493\n",
       "                ],\n",
       "                [\n",
       "                    0.5377427082199145,\n",
       "                    0.4111993350196099\n",
       "                ],\n",
       "                [\n",
       "                    0.2376618460766855,\n",
       "                    0.49005155816962975\n",
       "                ],\n",
       "                [\n",
       "                    0.756304847126138,\n",
       "                    0.24254216913372884\n",
       "                ],\n",
       "                [\n",
       "                    0.12974392242239607,\n",
       "                    0.921788274929667\n",
       "                ],\n",
       "                [\n",
       "                    0.9562862380506263,\n",
       "                    0.13151471812452953\n",
       "                ],\n",
       "                [\n",
       "                    0.3703413790657093,\n",
       "                    0.17644152218926368\n",
       "                ],\n",
       "                [\n",
       "                    0.9951544455120389,\n",
       "                    0.2694289236973274\n",
       "                ],\n",
       "                [\n",
       "                    0.09728388486907846,\n",
       "                    0.9088426206706584\n",
       "                ],\n",
       "                [\n",
       "                    0.4282989994116394,\n",
       "                    0.39355464815333074\n",
       "                ],\n",
       "                [\n",
       "                    0.10638065348025849,\n",
       "                    0.8954323161503\n",
       "                ],\n",
       "                [\n",
       "                    0.6564154956887386,\n",
       "                    0.41737602434265064\n",
       "                ],\n",
       "                [\n",
       "                    0.9892110233029475,\n",
       "                    0.2984524642673435\n",
       "                ],\n",
       "                [\n",
       "                    0.24553927112028773,\n",
       "                    0.8673766275507863\n",
       "                ],\n",
       "                [\n",
       "                    0.07134154653175395,\n",
       "                    0.9262098458071055\n",
       "                ],\n",
       "                [\n",
       "                    0.07268516377998391,\n",
       "                    0.42670147320954277\n",
       "                ],\n",
       "                [\n",
       "                    0.25446088523634813,\n",
       "                    0.5719288823300104\n",
       "                ],\n",
       "                [\n",
       "                    0.4631383894332769,\n",
       "                    0.46241071783776555\n",
       "                ],\n",
       "                [\n",
       "                    0.9039542432511403,\n",
       "                    0.11566735441044462\n",
       "                ],\n",
       "                [\n",
       "                    0.1605730920356322,\n",
       "                    0.6389649999956347\n",
       "                ],\n",
       "                [\n",
       "                    0.10207279761885724,\n",
       "                    0.30891852894650884\n",
       "                ],\n",
       "                [\n",
       "                    0.20780174440533805,\n",
       "                    0.11040981906903025\n",
       "                ],\n",
       "                [\n",
       "                    0.030241762292240293,\n",
       "                    0.6458319896002283\n",
       "                ],\n",
       "                [\n",
       "                    0.14007849066297196,\n",
       "                    0.6043432780691822\n",
       "                ],\n",
       "                [\n",
       "                    0.5269634488643468,\n",
       "                    0.2836909000251824\n",
       "                ],\n",
       "                [\n",
       "                    0.6066741394216488,\n",
       "                    0.36807270213379795\n",
       "                ],\n",
       "                [\n",
       "                    0.39206315469916553,\n",
       "                    0.4771121845389995\n",
       "                ],\n",
       "                [\n",
       "                    0.12121026866361295,\n",
       "                    0.23750967327432515\n",
       "                ],\n",
       "                [\n",
       "                    0.7872687067073411,\n",
       "                    0.9297737111214853\n",
       "                ],\n",
       "                [\n",
       "                    0.9646626430373806,\n",
       "                    0.5031262475666298\n",
       "                ],\n",
       "                [\n",
       "                    0.8731135546825839,\n",
       "                    0.20223939951949765\n",
       "                ],\n",
       "                [\n",
       "                    0.5345812109675233,\n",
       "                    0.38934689201229755\n",
       "                ],\n",
       "                [\n",
       "                    0.7363626827651818,\n",
       "                    0.32813155502710656\n",
       "                ],\n",
       "                [\n",
       "                    0.16789036713835614,\n",
       "                    0.8752161888571423\n",
       "                ],\n",
       "                [\n",
       "                    0.549118929478742,\n",
       "                    0.5096445780931677\n",
       "                ],\n",
       "                [\n",
       "                    0.5873675123443458,\n",
       "                    0.9633845559180155\n",
       "                ],\n",
       "                [\n",
       "                    0.6168654281652902,\n",
       "                    0.7909243552395547\n",
       "                ],\n",
       "                [\n",
       "                    0.050703540142007175,\n",
       "                    0.8606560710566903\n",
       "                ],\n",
       "                [\n",
       "                    0.6637226161134229,\n",
       "                    0.5980326685861173\n",
       "                ],\n",
       "                [\n",
       "                    0.6299645620754756,\n",
       "                    0.355046462120997\n",
       "                ],\n",
       "                [\n",
       "                    0.6579606072377313,\n",
       "                    0.24714457908818366\n",
       "                ],\n",
       "                [\n",
       "                    0.759703316320554,\n",
       "                    0.6365843161532012\n",
       "                ],\n",
       "                [\n",
       "                    0.6583573257153793,\n",
       "                    0.33326488735947046\n",
       "                ],\n",
       "                [\n",
       "                    0.4922057344524029,\n",
       "                    0.27623178196185294\n",
       "                ],\n",
       "                [\n",
       "                    0.17142055233451114,\n",
       "                    0.39889205027521524\n",
       "                ],\n",
       "                [\n",
       "                    0.539453065774525,\n",
       "                    0.11028969076373352\n",
       "                ],\n",
       "                [\n",
       "                    0.8968274310097673,\n",
       "                    0.7209930695417938\n",
       "                ],\n",
       "                [\n",
       "                    0.9543897043063734,\n",
       "                    0.9361944021548784\n",
       "                ],\n",
       "                [\n",
       "                    0.7767637999858297,\n",
       "                    0.8653964046118023\n",
       "                ],\n",
       "                [\n",
       "                    0.06963361505708743,\n",
       "                    0.8806147206112992\n",
       "                ],\n",
       "                [\n",
       "                    0.21696074340901195,\n",
       "                    0.47017868605298074\n",
       "                ],\n",
       "                [\n",
       "                    0.015707969787115195,\n",
       "                    0.2234393218988343\n",
       "                ],\n",
       "                [\n",
       "                    0.47778666016573623,\n",
       "                    0.791849659668593\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": false,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": null\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisTick\": {\n",
       "                \"show\": true,\n",
       "                \"alignWithLabel\": false,\n",
       "                \"inside\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": true,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_72394ccc6d55436ea9c664176b07498b.setOption(option_72394ccc6d55436ea9c664176b07498b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f14e4468490>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = np.random.rand(100)\n",
    "y = np.random.rand(100)\n",
    "(\n",
    "    Scatter(init_opts=opts.InitOpts(width=\"800px\", height=\"600px\"))\n",
    "    .add_xaxis(xaxis_data=x)\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=y,\n",
    "        symbol_size=20,\n",
    "        label_opts=opts.LabelOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts()\n",
    "    .set_global_opts(\n",
    "        xaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\", splitline_opts=opts.SplitLineOpts(is_show=True)\n",
    "        ),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            axistick_opts=opts.AxisTickOpts(is_show=True),\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=True),\n",
    "        ),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=False),\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 折线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f97bc7ae632e470c8ed3ba0a0b23c19a\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_f97bc7ae632e470c8ed3ba0a0b23c19a = echarts.init(\n",
       "                    document.getElementById('f97bc7ae632e470c8ed3ba0a0b23c19a'), 'white', {renderer: 'canvas'});\n",
       "                var option_f97bc7ae632e470c8ed3ba0a0b23c19a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.20431893065944606\n",
       "                ],\n",
       "                [\n",
       "                    0.1111111111111111,\n",
       "                    0.7042126824031081\n",
       "                ],\n",
       "                [\n",
       "                    0.2222222222222222,\n",
       "                    -1.3201753752549044\n",
       "                ],\n",
       "                [\n",
       "                    0.3333333333333333,\n",
       "                    -0.6313535414971617\n",
       "                ],\n",
       "                [\n",
       "                    0.4444444444444444,\n",
       "                    -0.19513310040050563\n",
       "                ],\n",
       "                [\n",
       "                    0.5555555555555556,\n",
       "                    1.2107875211988914\n",
       "                ],\n",
       "                [\n",
       "                    0.6666666666666666,\n",
       "                    -0.363528689406784\n",
       "                ],\n",
       "                [\n",
       "                    0.7777777777777777,\n",
       "                    -0.6433435158010464\n",
       "                ],\n",
       "                [\n",
       "                    0.8888888888888888,\n",
       "                    -0.9808697621292894\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.9542971681939766\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": null\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Line\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_f97bc7ae632e470c8ed3ba0a0b23c19a.setOption(option_f97bc7ae632e470c8ed3ba0a0b23c19a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f14c824edd0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.linspace(0, 1, 10)\n",
    "b = np.random.randn(20)\n",
    "(\n",
    "    Line()\n",
    "    .add_xaxis(a)\n",
    "    .add_yaxis('', b)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Line\"))\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 直方图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"8c6d06a5574f42b98f75bfd69a11ffe4\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_8c6d06a5574f42b98f75bfd69a11ffe4 = echarts.init(\n",
       "                    document.getElementById('8c6d06a5574f42b98f75bfd69a11ffe4'), 'white', {renderer: 'canvas'});\n",
       "                var option_8c6d06a5574f42b98f75bfd69a11ffe4 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"A\",\n",
       "            \"data\": [\n",
       "                0.6395164339677626,\n",
       "                0.5739207094344743,\n",
       "                0.8975385027907861,\n",
       "                0.08789809245875302,\n",
       "                0.7233612338025857,\n",
       "                0.29007739021750856,\n",
       "                0.41601813089541184,\n",
       "                0.9037109756422719,\n",
       "                0.6763314973936095,\n",
       "                0.46938036770032177\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"B\",\n",
       "            \"data\": [\n",
       "                0.7879742337329116,\n",
       "                0.6522356006084085,\n",
       "                0.8116008814250063,\n",
       "                0.03671224873844903,\n",
       "                0.06672960459859123,\n",
       "                0.3544397984972455,\n",
       "                0.12513621659680307,\n",
       "                0.3835963386681128,\n",
       "                0.5511920592831522,\n",
       "                0.9804534071370211\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"A\",\n",
       "                \"B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"A\": true,\n",
       "                \"B\": true\n",
       "            },\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"A\",\n",
       "                \"B\",\n",
       "                \"C\",\n",
       "                \"D\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_8c6d06a5574f42b98f75bfd69a11ffe4.setOption(option_8c6d06a5574f42b98f75bfd69a11ffe4);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f14bc0eb4d0>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = ['A', 'B', 'C', 'D']\n",
    "y1 = np.random.random(10)\n",
    "y2 = np.random.random(10)\n",
    "(\n",
    "    Bar()\n",
    "    .add_xaxis(x)\n",
    "    .add_yaxis(\"A\", list(y1))\n",
    "    .add_yaxis(\"B\", list(y2))\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Bar\"),\n",
    "        toolbox_opts=opts.ToolboxOpts(),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-21-d3c8fcf9bdd6>, line 5)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-21-d3c8fcf9bdd6>\"\u001b[0;36m, line \u001b[0;32m5\u001b[0m\n\u001b[0;31m    .add(\"\", [list(z) for z in zip(labels, nums)])\u001b[0m\n\u001b[0m    ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "labels = ['java', 'python', 'go', 'c', 'js']\n",
    "nums = [35, 66, 43, 22, 11]\n",
    "(\n",
    "    Pie()\n",
    "    .add(\"\", [list(z) for z in zip(labels, nums)])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Pie-基本示例\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 箱线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"a1170d4d8d3c47db876b1b9105924b44\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_a1170d4d8d3c47db876b1b9105924b44 = echarts.init(\n",
       "                    document.getElementById('a1170d4d8d3c47db876b1b9105924b44'), 'white', {renderer: 'canvas'});\n",
       "                var option_a1170d4d8d3c47db876b1b9105924b44 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"A\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    740,\n",
       "                    857.5,\n",
       "                    940.0,\n",
       "                    980.0,\n",
       "                    1070\n",
       "                ],\n",
       "                [\n",
       "                    790,\n",
       "                    832.5,\n",
       "                    880.0,\n",
       "                    940.0,\n",
       "                    960\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"B\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    740,\n",
       "                    760.0,\n",
       "                    805.0,\n",
       "                    872.5,\n",
       "                    920\n",
       "                ],\n",
       "                [\n",
       "                    760,\n",
       "                    795.0,\n",
       "                    815.0,\n",
       "                    865.0,\n",
       "                    890\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"A\",\n",
       "                \"B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"A\": true,\n",
       "                \"B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"expr1\",\n",
       "                \"expr2\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"BoxPlot-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_a1170d4d8d3c47db876b1b9105924b44.setOption(option_a1170d4d8d3c47db876b1b9105924b44);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f14bc10c650>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v1 = [\n",
    "    [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880, 1000, 980],\n",
    "    [960, 940, 960, 940, 880, 800, 850, 880, 900, 840, 830, 790],\n",
    "]\n",
    "v2 = [\n",
    "    [890, 810, 810, 820, 800, 770, 760, 740, 750, 760, 910, 920],\n",
    "    [890, 840, 780, 810, 760, 810, 790, 810, 820, 850, 870, 870],\n",
    "]\n",
    "c = Boxplot()\n",
    "c.add_xaxis([\"expr1\", \"expr2\"])\n",
    "c.add_yaxis(\"A\", c.prepare_data(v1))\n",
    "c.add_yaxis(\"B\", c.prepare_data(v2))\n",
    "c.set_global_opts(title_opts=opts.TitleOpts(title=\"BoxPlot-基本示例\"))\n",
    "c.render_notebook()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 词云图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'echarts-wordcloud':'https://assets.pyecharts.org/assets/echarts-wordcloud.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5b24e1c77ce049feb8a2dfb01bef3c10\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'echarts-wordcloud'], function(echarts) {\n",
       "                var chart_5b24e1c77ce049feb8a2dfb01bef3c10 = echarts.init(\n",
       "                    document.getElementById('5b24e1c77ce049feb8a2dfb01bef3c10'), 'white', {renderer: 'canvas'});\n",
       "                var option_5b24e1c77ce049feb8a2dfb01bef3c10 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"wordCloud\",\n",
       "            \"name\": \"\\u70ed\\u70b9\\u5206\\u6790\",\n",
       "            \"shape\": \"circle\",\n",
       "            \"rotationRange\": [\n",
       "                -90,\n",
       "                90\n",
       "            ],\n",
       "            \"rotationStep\": 45,\n",
       "            \"girdSize\": 20,\n",
       "            \"sizeRange\": [\n",
       "                6,\n",
       "                66\n",
       "            ],\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"Java\",\n",
       "                    \"value\": \"999\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(28,32,1)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Python\",\n",
       "                    \"value\": \"888\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(63,88,98)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Go\",\n",
       "                    \"value\": \"777\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(153,136,108)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"C++\",\n",
       "                    \"value\": \"688\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(34,144,115)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"C\",\n",
       "                    \"value\": \"588\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(111,56,12)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PHP\",\n",
       "                    \"value\": \"516\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(35,94,144)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"JS\",\n",
       "                    \"value\": \"515\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(69,67,78)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Ruby\",\n",
       "                    \"value\": \"483\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(83,119,78)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Perl\",\n",
       "                    \"value\": \"462\",\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(126,145,56)\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"drawOutOfBound\": false,\n",
       "            \"textStyle\": {\n",
       "                \"emphasis\": {}\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u70ed\\u70b9\\u5206\\u6790\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 23\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5b24e1c77ce049feb8a2dfb01bef3c10.setOption(option_5b24e1c77ce049feb8a2dfb01bef3c10);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f14bc0f6190>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = [\n",
    "    (\"Java\", \"999\"),\n",
    "    (\"Python\", \"888\"),\n",
    "    (\"Go\", \"777\"),\n",
    "    (\"C++\", \"688\"),\n",
    "    (\"C\", \"588\"),\n",
    "    (\"PHP\", \"516\"),\n",
    "    (\"JS\", \"515\"),\n",
    "    (\"Ruby\", \"483\"),\n",
    "    (\"Perl\", \"462\")\n",
    "]\n",
    "(\n",
    "    WordCloud()\n",
    "    .add(series_name=\"热点分析\", data_pair=data, word_size_range=[6, 66])\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"热点分析\", title_textstyle_opts=opts.TextStyleOpts(font_size=23)\n",
    "        ),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=True),\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
